<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>剪裁</title>
    <style>
        div {
            margin: 200px auto;
            position: relative;
            width: 400px;
            height: 300px;
        }

        div::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border: 2px solid rgb(50, 115, 255);
            /* animation: clippath 3s infinite linear; */
            animation: clippath 3s infinite;
        }

        @keyframes clippath {

            0%,
            100% {
                clip-path: inset(0 0 95% 0);
            }

            25% {
                clip-path: inset(0 95% 0 0);
            }

            50% {
                clip-path: inset(95% 0 0 0);
            }

            75% {
                clip-path: inset(0 0 0 95%);
            }
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>